package cn.szsys.integration.constants;

import lombok.Getter;

/**
 * @author Ryan
 * @since 2025-05-08
 **/
@Getter
public enum BillingRuleServiceTypeEnum {
    /**
     * 服务类型(1.上游 2.下游)
     */
    UPSTREAM(1, "上游"),
    DOWNSTREAM(2, "下游");
    private final int code;
    private final String desc;
    BillingRuleServiceTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static BillingRuleServiceTypeEnum getByCode(int code) {
        for (BillingRuleServiceTypeEnum billingRuleServiceTypeEnum : BillingRuleServiceTypeEnum.values()) {
            if (billingRuleServiceTypeEnum.getCode() == code) {
                return billingRuleServiceTypeEnum;
            }
        }
        return null;
    }
}
